package com.sky.config;

import com.sky.properties.AliOssProperties;
import com.sky.utils.AliOssUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AliOssConfig {

    @Bean
    public AliOssUtil aliOssUtil(AliOssProperties properties){
        String accessKeyId = properties.getAccessKeyId();
        String endpoint = properties.getEndpoint();
        String accessKeySecret = properties.getAccessKeySecret();
        String bucketName = properties.getBucketName();
        AliOssUtil aliOssUtil=new AliOssUtil(endpoint,accessKeyId,accessKeySecret,bucketName);
        System.out.println(aliOssUtil);
        return aliOssUtil;
    }
}
